package com.mz.ozy.mvp.presenter;


import android.app.Activity;

import com.mz.ozy.base.BasePresenterImpl;
import com.mz.ozy.bean.OrderListBean;
import com.mz.ozy.mvp.model.MeModel;
import com.mz.ozy.mvp.view.MyBalanceContract;
import com.mz.ozy.net.MyObserver;
import com.mz.ozy.utils.RxUtil;

import okhttp3.ResponseBody;

/**
 * Created by administrator on 2018/12/3.
 */
public class MyBalancePresenter extends BasePresenterImpl<MyBalanceContract.View> implements MyBalanceContract.Presenter {

    private MeModel mModel;


    public MyBalancePresenter() {
        mModel = new MeModel();
    }


    @Override
    public void getInfo(Activity activity, String page, String url) {
        mModel.getBalanceInfo(activity, page, url)
                .compose(RxUtil.rxSchedulerHelper(mView.<ResponseBody>bindToLifecycle()))
                .subscribe(new MyObserver<OrderListBean>(mView) {
                    @Override
                    public void onSuccesss(OrderListBean bean) {
                        mView.getBanclceInfo(bean);
                    }
                });
    }
}
